package load2;

public class loading {
    private String name;
    private String password;


    public loading() {
    }

    public loading(String name, String password) {
        this.name = name;
        this.password = password;
    }

    /**
     * 获取
     * @return name
     */
    public String getName() {
        return name;
    }

    /**
     * 设置
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * 获取
     * @return password
     */
    public String getPassword() {
        return password;
    }

    /**
     * 设置
     * @param password
     */
    public void setPassword(String password) {
        this.password = password;
    }

    public void login(String name,String password){
        if(!this.name.equals(name)){
            throw new UserNameException("用户名错误！");
        }
        if(!this.password.equals(password)){
            throw new PassWordException("密码错误！");
        }
    }

}
